home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / ffield.zip / WORLD.QC < prev    next >
Text File  |  1996-10-28  |  11KB  |  394 lines

  1.  
  2. void() InitBodyQue;
  3.  
  4.  
  5. void() main =
  6. {
  7.     dprint ("main function\n");
  8.     
  9. // these are just commands the the prog compiler to copy these files
  10.  
  11.     precache_file ("progs.dat");
  12.     precache_file ("gfx.wad");
  13.     precache_file ("quake.rc");
  14.     precache_file ("default.cfg");
  15.  
  16.     precache_file ("end1.bin");
  17.     precache_file2 ("end2.bin");
  18.  
  19.     precache_file ("demo1.dem");
  20.     precache_file ("demo2.dem");
  21.     precache_file ("demo3.dem");
  22.  
  23. //
  24. // these are all of the lumps from the cached.ls files
  25. //
  26.     precache_file ("gfx/palette.lmp");
  27.     precache_file ("gfx/colormap.lmp");
  28.  
  29.     precache_file2 ("gfx/pop.lmp");
  30.  
  31.     precache_file ("gfx/complete.lmp");
  32.     precache_file ("gfx/inter.lmp");
  33.  
  34.     precache_file ("gfx/ranking.lmp");
  35.     precache_file ("gfx/vidmodes.lmp");
  36.     precache_file ("gfx/finale.lmp");
  37.     precache_file ("gfx/conback.lmp");
  38.     precache_file ("gfx/qplaque.lmp");
  39.  
  40.     precache_file ("gfx/menudot1.lmp");
  41.     precache_file ("gfx/menudot2.lmp");
  42.     precache_file ("gfx/menudot3.lmp");
  43.     precache_file ("gfx/menudot4.lmp");
  44.     precache_file ("gfx/menudot5.lmp");
  45.     precache_file ("gfx/menudot6.lmp");
  46.  
  47.     precache_file ("gfx/menuplyr.lmp");
  48.     precache_file ("gfx/bigbox.lmp");
  49.     precache_file ("gfx/dim_modm.lmp");
  50.     precache_file ("gfx/dim_drct.lmp");
  51.     precache_file ("gfx/dim_ipx.lmp");
  52.     precache_file ("gfx/dim_tcp.lmp");
  53.     precache_file ("gfx/dim_mult.lmp");
  54.     precache_file ("gfx/mainmenu.lmp");
  55.     
  56.     precache_file ("gfx/box_tl.lmp");
  57.     precache_file ("gfx/box_tm.lmp");
  58.     precache_file ("gfx/box_tr.lmp");
  59.     
  60.     precache_file ("gfx/box_ml.lmp");
  61.     precache_file ("gfx/box_mm.lmp");
  62.     precache_file ("gfx/box_mm2.lmp");
  63.     precache_file ("gfx/box_mr.lmp");
  64.     
  65.     precache_file ("gfx/box_bl.lmp");
  66.     precache_file ("gfx/box_bm.lmp");
  67.     precache_file ("gfx/box_br.lmp");
  68.     
  69.     precache_file ("gfx/sp_menu.lmp");
  70.     precache_file ("gfx/ttl_sgl.lmp");
  71.     precache_file ("gfx/ttl_main.lmp");
  72.     precache_file ("gfx/ttl_cstm.lmp");
  73.     
  74.     precache_file ("gfx/mp_menu.lmp");
  75.     
  76.     precache_file ("gfx/netmen1.lmp");
  77.     precache_file ("gfx/netmen2.lmp");
  78.     precache_file ("gfx/netmen3.lmp");
  79.     precache_file ("gfx/netmen4.lmp");
  80.     precache_file ("gfx/netmen5.lmp");
  81.     
  82.     precache_file ("gfx/sell.lmp");
  83.     
  84.     precache_file ("gfx/help0.lmp");
  85.     precache_file ("gfx/help1.lmp");
  86.     precache_file ("gfx/help2.lmp");
  87.     precache_file ("gfx/help3.lmp");
  88.     precache_file ("gfx/help4.lmp");
  89.     precache_file ("gfx/help5.lmp");
  90.  
  91.     precache_file ("gfx/pause.lmp");
  92.     precache_file ("gfx/loading.lmp");
  93.  
  94.     precache_file ("gfx/p_option.lmp");
  95.     precache_file ("gfx/p_load.lmp");
  96.     precache_file ("gfx/p_save.lmp");
  97.     precache_file ("gfx/p_multi.lmp");
  98.  
  99.                             // sounds loaded by C code
  100.     precache_sound ("misc/menu1.wav");
  101.     precache_sound ("misc/menu2.wav");
  102.     precache_sound ("misc/menu3.wav");
  103.  
  104.     precache_sound ("ambience/water1.wav");
  105.     precache_sound ("ambience/wind2.wav");
  106.  
  107.                             // shareware
  108.     precache_file ("maps/start.bsp");
  109.  
  110.     precache_file ("maps/e1m1.bsp");
  111.     precache_file ("maps/e1m2.bsp");
  112.     precache_file ("maps/e1m3.bsp");
  113.     precache_file ("maps/e1m4.bsp");
  114.     precache_file ("maps/e1m5.bsp");
  115.     precache_file ("maps/e1m6.bsp");
  116.     precache_file ("maps/e1m7.bsp");
  117.     precache_file ("maps/e1m8.bsp");
  118.  
  119.                             // registered
  120.     precache_file2 ("gfx/pop.lmp");
  121.  
  122.     precache_file2 ("maps/e2m1.bsp");
  123.     precache_file2 ("maps/e2m2.bsp");
  124.     precache_file2 ("maps/e2m3.bsp");
  125.     precache_file2 ("maps/e2m4.bsp");
  126.     precache_file2 ("maps/e2m5.bsp");
  127.     precache_file2 ("maps/e2m6.bsp");
  128.     precache_file2 ("maps/e2m7.bsp");
  129.  
  130.     precache_file2 ("maps/e3m1.bsp");
  131.     precache_file2 ("maps/e3m2.bsp");
  132.     precache_file2 ("maps/e3m3.bsp");
  133.     precache_file2 ("maps/e3m4.bsp");
  134.     precache_file2 ("maps/e3m5.bsp");
  135.     precache_file2 ("maps/e3m6.bsp");
  136.     precache_file2 ("maps/e3m7.bsp");
  137.  
  138.     precache_file2 ("maps/e4m1.bsp");
  139.     precache_file2 ("maps/e4m2.bsp");
  140.     precache_file2 ("maps/e4m3.bsp");
  141.     precache_file2 ("maps/e4m4.bsp");
  142.     precache_file2 ("maps/e4m5.bsp");
  143.     precache_file2 ("maps/e4m6.bsp");
  144.     precache_file2 ("maps/e4m7.bsp");
  145.     precache_file2 ("maps/e4m8.bsp");
  146.  
  147.     precache_file2 ("maps/end.bsp");
  148.  
  149.     precache_file2 ("maps/dm1.bsp");
  150.     precache_file2 ("maps/dm2.bsp");
  151.     precache_file2 ("maps/dm3.bsp");
  152.     precache_file2 ("maps/dm4.bsp");
  153.     precache_file2 ("maps/dm5.bsp");
  154.     precache_file2 ("maps/dm6.bsp");
  155. };
  156.  
  157.  
  158. entity    lastspawn;
  159.  
  160. //=======================
  161. /*QUAKED worldspawn (0 0 0) ?
  162. Only used for the world entity.
  163. Set message to the level name.
  164. Set sounds to the cd track to play.
  165.  
  166. World Types:
  167. 0: medieval
  168. 1: metal
  169. 2: base
  170. */
  171. //=======================
  172. void() worldspawn =
  173. {
  174.     lastspawn = world;
  175.     InitBodyQue ();
  176.  
  177. // custom map attributes
  178.     if (self.model == "maps/e1m8.bsp")
  179.         cvar_set ("sv_gravity", "100");
  180.     else
  181.         cvar_set ("sv_gravity", "800");
  182.  
  183. // the area based ambient sounds MUST be the first precache_sounds
  184.  
  185. // player precaches    
  186.     W_Precache ();                    // get weapon precaches
  187.  
  188. // sounds used from C physics code
  189.     precache_sound ("demon/dland2.wav");        // landing thud
  190.     precache_sound ("misc/h2ohit1.wav");        // landing splash
  191.  
  192. // setup precaches allways needed
  193.     precache_sound ("items/itembk2.wav");        // item respawn sound
  194.     precache_sound ("player/plyrjmp8.wav");        // player jump
  195.     precache_sound ("player/land.wav");        // player landing
  196.     precache_sound ("player/land2.wav");        // player hurt landing
  197.     precache_sound ("player/drown1.wav");        // drowning pain
  198.     precache_sound ("player/drown2.wav");        // drowning pain
  199.     precache_sound ("player/gasp1.wav");        // gasping for air
  200.     precache_sound ("player/gasp2.wav");        // taking breath
  201.     precache_sound ("player/h2odeath.wav");        // drowning death
  202.  
  203.     precache_sound ("misc/talk.wav");        // talk
  204.     precache_sound ("player/teledth1.wav");        // telefrag
  205.     precache_sound ("misc/r_tele1.wav");        // teleport sounds
  206.     precache_sound ("misc/r_tele2.wav");
  207.     precache_sound ("misc/r_tele3.wav");
  208.     precache_sound ("misc/r_tele4.wav");
  209.     precache_sound ("misc/r_tele5.wav");
  210.     precache_sound ("weapons/lock4.wav");        // ammo pick up
  211.     precache_sound ("weapons/pkup.wav");        // weapon up
  212.     precache_sound ("items/armor1.wav");        // armor up
  213.     precache_sound ("weapons/lhit.wav");        //lightning
  214.     precache_sound ("weapons/lstart.wav");        //lightning start
  215.     precache_sound ("items/damage3.wav");
  216.  
  217.     precache_sound ("misc/power.wav");        //lightning for boss
  218.  
  219. // player gib sounds
  220.     precache_sound ("player/gib.wav");        // player gib sound
  221.     precache_sound ("player/udeath.wav");        // player gib sound
  222.     precache_sound ("player/tornoff2.wav");        // gib sound
  223.  
  224. // player pain sounds
  225.  
  226.     precache_sound ("player/pain1.wav");
  227.     precache_sound ("player/pain2.wav");
  228.     precache_sound ("player/pain3.wav");
  229.     precache_sound ("player/pain4.wav");
  230.     precache_sound ("player/pain5.wav");
  231.     precache_sound ("player/pain6.wav");
  232.  
  233. // player death sounds
  234.     precache_sound ("player/death1.wav");
  235.     precache_sound ("player/death2.wav");
  236.     precache_sound ("player/death3.wav");
  237.     precache_sound ("player/death4.wav");
  238.     precache_sound ("player/death5.wav");
  239.  
  240. // ax sounds    
  241.     precache_sound ("weapons/ax1.wav");        // ax swoosh
  242.     precache_sound ("player/axhit1.wav");        // ax hit meat
  243.     precache_sound ("player/axhit2.wav");        // ax hit world
  244.  
  245.     precache_sound ("player/h2ojump.wav");        // player jumping into water
  246.     precache_sound ("player/slimbrn2.wav");        // player enter slime
  247.     precache_sound ("player/inh2o.wav");        // player enter water
  248.     precache_sound ("player/inlava.wav");        // player enter lava
  249.     precache_sound ("misc/outwater.wav");        // leaving water sound
  250.  
  251.     precache_sound ("player/lburn1.wav");        // lava burn
  252.     precache_sound ("player/lburn2.wav");        // lava burn
  253.  
  254.     precache_sound ("misc/water1.wav");        // swimming
  255.     precache_sound ("misc/water2.wav");        // swimming
  256.  
  257.     precache_model ("progs/player.mdl");
  258.     precache_model ("progs/eyes.mdl");
  259.     precache_model ("progs/h_player.mdl");
  260.     precache_model ("progs/gib1.mdl");
  261.     precache_model ("progs/gib2.mdl");
  262.     precache_model ("progs/gib3.mdl");
  263.  
  264.     precache_model ("progs/s_bubble.spr");    // drowning bubbles
  265.     precache_model ("progs/s_explod.spr");    // sprite explosion
  266.  
  267.     precache_model ("progs/v_axe.mdl");
  268.     precache_model ("progs/v_shot.mdl");
  269.     precache_model ("progs/v_nail.mdl");
  270.     precache_model ("progs/v_rock.mdl");
  271.     precache_model ("progs/v_shot2.mdl");
  272.     precache_model ("progs/v_nail2.mdl");
  273.     precache_model ("progs/v_rock2.mdl");
  274.  
  275.     precache_model ("progs/bolt.mdl");        // for lightning gun
  276.     precache_model ("progs/bolt2.mdl");        // for lightning gun
  277.     precache_model ("progs/bolt3.mdl");        // for boss shock
  278.     precache_model ("progs/lavaball.mdl");    // for testing
  279.     
  280.     precache_model ("progs/missile.mdl");
  281.     precache_model ("progs/grenade.mdl");
  282.     precache_model ("progs/spike.mdl");
  283.     precache_model ("progs/s_spike.mdl");
  284.  
  285.     precache_model ("progs/backpack.mdl");
  286.  
  287.     precache_model ("progs/zom_gib.mdl");
  288.  
  289.     precache_model ("progs/v_light.mdl");
  290.     
  291.  
  292. //
  293. // Setup light animation tables. 'a' is total darkness, 'z' is maxbright.
  294. //
  295.  
  296.     // 0 normal
  297.     lightstyle(0, "m");
  298.     
  299.     // 1 FLICKER (first variety)
  300.     lightstyle(1, "mmnmmommommnonmmonqnmmo");
  301.     
  302.     // 2 SLOW STRONG PULSE
  303.     lightstyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba");
  304.     
  305.     // 3 CANDLE (first variety)
  306.     lightstyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");
  307.     
  308.     // 4 FAST STROBE
  309.     lightstyle(4, "mamamamamama");
  310.     
  311.     // 5 GENTLE PULSE 1
  312.     lightstyle(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj");
  313.     
  314.     // 6 FLICKER (second variety)
  315.     lightstyle(6, "nmonqnmomnmomomno");
  316.     
  317.     // 7 CANDLE (second variety)
  318.     lightstyle(7, "mmmaaaabcdefgmmmmaaaammmaamm");
  319.     
  320.     // 8 CANDLE (third variety)
  321.     lightstyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");
  322.     
  323.     // 9 SLOW STROBE (fourth variety)
  324.     lightstyle(9, "aaaaaaaazzzzzzzz");
  325.     
  326.     // 10 FLUORESCENT FLICKER
  327.     lightstyle(10, "mmamammmmammamamaaamammma");
  328.  
  329.     // 11 SLOW PULSE NOT FADE TO BLACK
  330.     lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba");
  331.     
  332.     // styles 32-62 are assigned by the light program for switchable lights
  333.  
  334.     // 63 testing
  335.     lightstyle(63, "a");
  336. };
  337.  
  338. void() StartFrame =
  339. {
  340.     teamplay = cvar("teamplay");
  341.     skill = cvar("skill");
  342.     framecount = framecount + 1;
  343. };
  344.  
  345. /*
  346. ==============================================================================
  347.  
  348. BODY QUE
  349.  
  350. ==============================================================================
  351. */
  352.  
  353. entity    bodyque_head;
  354.  
  355. void() bodyque =
  356. {    // just here so spawn functions don't complain after the world
  357.     // creates bodyques
  358. };
  359.  
  360. void() InitBodyQue =
  361. {
  362.     local entity    e;
  363.     
  364.     bodyque_head = spawn();
  365.     bodyque_head.classname = "bodyque";
  366.     bodyque_head.owner = spawn();
  367.     bodyque_head.owner.classname = "bodyque";
  368.     bodyque_head.owner.owner = spawn();
  369.     bodyque_head.owner.owner.classname = "bodyque";
  370.     bodyque_head.owner.owner.owner = spawn();
  371.     bodyque_head.owner.owner.owner.classname = "bodyque";
  372.     bodyque_head.owner.owner.owner.owner = bodyque_head;
  373. };
  374.  
  375.  
  376. // make a body que entry for the given ent so the ent can be
  377. // respawned elsewhere
  378. void(entity ent) CopyToBodyQue =
  379. {
  380.     bodyque_head.angles = ent.angles;
  381.     bodyque_head.model = ent.model;
  382.     bodyque_head.modelindex = ent.modelindex;
  383.     bodyque_head.frame = ent.frame;
  384.     bodyque_head.colormap = ent.colormap;
  385.     bodyque_head.movetype = ent.movetype;
  386.     bodyque_head.velocity = ent.velocity;
  387.     bodyque_head.flags = 0;
  388.     setorigin (bodyque_head, ent.origin);
  389.     setsize (bodyque_head, ent.mins, ent.maxs);
  390.     bodyque_head = bodyque_head.owner;
  391. };
  392.  
  393.  
  394.